package com.tte.common.designpattern.factory;

import com.tte.common.designpattern.service.Place;
import com.tte.common.designpattern.service.impl.*;

/**
 * PlaceFactory
 */
public class PlaceFactory {
    //使用 getShape 方法获取形状类型的对象
    public Place getPlace(String place){
        if(place == null){
            return null;
        }
        if(place.equalsIgnoreCase("china")){
            return new ChinaImpl();
        } else if(place.equalsIgnoreCase("russial")){
            return new RussiaImpl();
        } else if(place.equalsIgnoreCase("usa")){
            return new USAImpl();
        }
        return null;
    }
}
